import { Slot, Slots } from 'vue'

export function useSlot<S extends Record<string, Slot>>(slots: Slots, name = 'default') {
  const slot = slots[name]
  return slot === undefined ? undefined : slot()
}
